package com.dragon.smtp.dao;

import com.dragon.smtp.domain.Mailbox;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 小龙
 * @since 2022-11-08
 */
@Mapper
public interface MailboxDao extends BaseMapper<Mailbox> {
    @Select("select * from mailbox where from_email=#{fromUsername} and to_email=#{toUsername} and status=1 and username=#{fromUsername}")
    Mailbox selectFrombox(String fromUsername,String toUsername);

    @Select("select * from mailbox where  to_email=#{username} and status=1 and username=#{username}")
    Mailbox selectTobox(String username);
}
